package com.cvte.boe.media.utils;

import android.content.Context;

import com.cvte.boe.media.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wuguitong on 2018/5/3.
 */
public class SettingUtil {
    public static final String IMAGELOOP = "IMAGELOOP";
    public static final String IMAGELOOPTIMER = "IMAGELOOPTIMER";
    public static final String VIDEODISPLAY = "VIDEODISPLAY";
    public static final String VIDEOAUDIO = "VIDEOAUDIO";
    public static final String VIDEOSUBTITLE = "VIDEOSUBTITLE";
    public static final String VIDEOLOOP = "VIDEOLOOP";
    public static final String MUSICPLAYMODE = "MUSICPLAYMODE";

    public enum ILOOP{
        ON(R.string.image_player_setting_loop_on),OFF(R.string.image_player_setting_loop_off);
        private int strID;
        private ILOOP(int id){
            this.strID = id;
        }
        public int getStrID(){
            return strID;
        }
    }
    public enum ILOOPTIMER {
        SEC_5(R.string.image_setting_loop_timer_5_sec),SEC_10(R.string.image_setting_loop_timer_10_sec),SEC_20(R.string.image_setting_loop_timer_20_sec),SEC_30(R.string.image_setting_loop_timer_30_sec),
        MIN_1(R.string.image_setting_loop_timer_1_min),MIN_2(R.string.image_setting_loop_timer_2_min),MIN_5(R.string.image_setting_loop_timer_5_min),MIN_10(R.string.image_setting_loop_timer_10_min),
        MIN_30(R.string.image_setting_loop_timer_30_min),MIN_60(R.string.image_setting_loop_timer_60_min),MIN_120(R.string.image_setting_loop_timer_120_min);
        private int strID;
        private ILOOPTIMER(int id){
            this.strID = id;
        }
        public int getStrID(){
            return strID;
        }
    }
    public enum VDISPLAY {
        FULLSCREEN(R.string.video_setting_display_full),AUTOSCREEN(R.string.video_setting_display_auto);
        private int strID;
        private VDISPLAY(int id){
            this.strID = id;
        }
        public int getStrID(){
            return strID;
        }
    }
    public enum VAUDIO {
        EXCHANGE(R.string.video_setting_audio_exchange),ONLYLEFT(R.string.video_setting_audio_onlyleft),ONLYRIGHT(R.string.video_setting_audio_onlyright),STEREO(R.string.video_setting_audio_stereo),
        DOUBLEMONO(R.string.video_setting_audio_doublemono),DOUBLELEFT(R.string.video_setting_audio_doubleleft),DOUBLERIGHT(R.string.video_setting_audio_dounleright);
        private int strID;
        private VAUDIO(int id){
            this.strID = id;
        }
        public int getStrID(){
            return strID;
        }
    }
    public enum VSUBTITLE {
        ON(R.string.video_setting_subtitle_on),OFF(R.string.video_setting_subtitle_off);
        private int strID;
        private VSUBTITLE(int id){
            this.strID = id;
        }
        public int getStrID(){
            return strID;
        }
    }
    public enum VLOOP {
        FULLCYCLE(R.string.video_setting_loop_fullcycle),SINGLECYCLE(R.string.video_setting_loop_singlecycle);
        private int strID;
        private VLOOP(int id){
            this.strID = id;
        }
        public int getStrID(){
            return strID;
        }
    }
    public enum MPLAYMODE {
        REPEATOFF(R.drawable.music_playmode_repeatoff),REPEATALL(R.drawable.music_playmode_repeatall),PLAYONCE(R.drawable.music_playmode_playonce),
        REPEATCURSONG(R.drawable.music_playmode_repeatcursong),SHUFFLE(R.drawable.music_playmode_shuffle);
        private int imgID;
        private MPLAYMODE(int id){
            this.imgID = id;
        }
        public int getImgID(){
            return imgID;
        }
    }
    public static  List<String> getList(Context context,String key){
        ArrayList<String> list = new ArrayList<String>();
        switch (key){
            case IMAGELOOP:
                for(ILOOP t:ILOOP.values()){
                    list.add(context.getResources().getString(t.getStrID()));
                }
                break;
            case IMAGELOOPTIMER:
                for(ILOOPTIMER t:ILOOPTIMER.values()){
                    list.add(context.getResources().getString(t.getStrID()));
                }
                break;
            case VIDEOAUDIO:
                for(VAUDIO t:VAUDIO.values()){
                    list.add(context.getResources().getString(t.getStrID()));
                }
                break;
            case VIDEODISPLAY:
                for(VDISPLAY t:VDISPLAY.values()){
                    list.add(context.getResources().getString(t.getStrID()));
                }
                break;
            case VIDEOLOOP:
                for(VLOOP t:VLOOP.values()){
                    list.add(context.getResources().getString(t.getStrID()));
                }
                break;
            case VIDEOSUBTITLE:
                for(VSUBTITLE t:VSUBTITLE.values()){
                    list.add(context.getResources().getString(t.getStrID()));
                }
                break;
        }
        return list;
    }
}
